var mongoose = require("mongoose");
var Schema = mongoose.Schema;

var orderSchema = new Schema({
    openid: String,
    imgPath: String,
    wxOrder: Object,
    wxPayNotify: Object,
    out_trade_no: String,
    order_sheet: String,
    name: String,
    phone: String,
    preAddress: String,
    detailAddress: String,
    date: String,
    message: String,
    express_company: String,
    express_order: String,
    express_per: String,
    express_perPhone: String,
    ifPay: {type: Boolean, default: false},
    ifGet: {type: Boolean, default: false},
    ifSend: {type: Boolean, default: false},
    ifCancel: {type: Boolean, default: false},
    deliveryTime: {type: Number, default: 3},
    tmp: Array,//payOrder
    totalMoney: Number,
    createTime: {type: Date, default: Date.now()},
    logistics: Object
});

module.exports = mongoose.model("orders", orderSchema );